package com.epoch.common;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Map;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Message implements Serializable {
    private static final long serialVersionUID = 6672407421355829127L;
    private String message;//信息内容
    private Integer sender;//发送者
    private String senderName; //发送者的姓名
    private Integer groupId;//发送的群聊id
    private String date;//日期]
    private String messageType; //信息类型
    private Map<String, Object> dynamicData; // 动态数据

    //格式化时间
    public void setDate(Date d) {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
        this.date = sdf.format(d);
    }
}